#ifndef _COMMAND_BATCH_HPP
#define _COMMAND_BATCH_HPP 1


#include <vector>
#include <boost/shared_ptr.hpp>
#include "Entry.hpp"

namespace BFT
{
	namespace messages
	{
	
		class CommandBatch
		{
			public:
			
			CommandBatch(boost::shared_ptr<std::vector< boost::shared_ptr<BFT::messages::Entry> > > _entries, uint16_t _entryCount);
			CommandBatch(boost::shared_ptr<std::vector< boost::shared_ptr<BFT::messages::Entry> > > _entries);
			CommandBatch(boost::shared_ptr<char> _bytes, int _bytes_size, uint16_t _count);
			
			boost::shared_ptr<std::vector< boost::shared_ptr <Entry> > >getEntries();
			uint16_t getEntryCount();
			int getSize();
			boost::shared_ptr<char> getBytes(int &_bytes_size);
			bool equals(boost::shared_ptr<CommandBatch> b);
						
			void printInfo();
			
			protected:
	
			boost::shared_ptr<char> bytes;
			boost::shared_ptr<std::vector< boost::shared_ptr<BFT::messages::Entry> > > entries;
			uint16_t entryCount;
			int bytes_size;
			
		};
		
		inline uint16_t CommandBatch::getEntryCount() {return entryCount;}
		inline boost::shared_ptr<std::vector< boost::shared_ptr <Entry> > > CommandBatch::getEntries() {return entries;}
	
	}//MESSAGES
}//BFT

#endif
